package com.juyu.miliao.common.dataSource;

import org.apache.commons.lang3.StringUtils;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

import com.juyu.miliao.common.dataSource.key.DataSourceKey;

import javax.sql.DataSource;

public class MultipleDataSource extends AbstractRoutingDataSource{
	private final DataSourceKey dataSourceKey;
	
	public MultipleDataSource(DataSourceKey dataSourceKey){
		this.dataSourceKey = dataSourceKey;
	}
	
	@Override
	protected Object determineCurrentLookupKey() {
		return dataSourceKey.get();
	}

}
